package com.personal.dao;

import com.personal.entity.Shop;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 萌新
 * @version 1.0
 * @date 2021/4/13 17:10
 */

public interface ShopDao {

    /**
     * 分页查询店铺，可输入的条件有：店铺名(模糊)，店铺状态，店铺类别，区域id，owner
     * @param shopCondition
     * @param rowIndex 从第几行开始取值
     * @param pageSize 返回的条数
     * @return
     */
    List<Shop> queryShopList(@Param("shopCondition") Shop shopCondition,
                             @Param("rowIndex") int rowIndex,@Param("pageSize") int pageSize);

    /**
     * 返回queryShopList 的查询总数
     * @param shopCondition
     * @return
     */
    int queryShopCount(@Param("shopCondition") Shop shopCondition);

    /**
     * 新增店铺
     * @param shop
     * @return int
     */
    int insertShop(Shop shop);

    /**
     * 更新店铺
     * @param shop
     * @return int
     */
    int updateShop(Shop shop);

    /**
     * 通过shop id 查询店铺
     * @param shopId
     * @return
     */
    Shop queryByShopId(long shopId);

}
